/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package schedulingScheme;

import java.util.BitSet;
import java.util.List;

/**
 *
 * @author Andrzej
 */
public class CoverageMatrix {
    private BitSet[] R;

    public CoverageMatrix(List<SensorNode> nodes, List<POI> pois) {
        R = new BitSet[nodes.size()];
        for (int i=0; i < R.length; i++){
            R[i] = new BitSet(pois.size());
        }
                for (int i = 0; i < nodes.size(); i++) {
            for (int j = 0; j < pois.size(); j++) {
//                b.set(i, true);
                setSensorInRange(i, j, nodes.get(i).inRange(pois.get(j)));
            }
        }
    }

    private void setSensorInRange(int sensor, int poi, boolean inRange){
        R[sensor].set(poi,inRange);
    }

    public BitSet coverageOfSensor(int sensor){
        return R[sensor];
    }

}
